package net.jmchilton.spring.collect.google.test;

import com.google.common.base.Function;

/**
 * For Testing.
 * 
 * @author John Chilton
 *
 */
public class AddFunction implements Function<Integer, Integer> {
  private int amount;

  /**
   * Initialize amount to 1.
   */
  public AddFunction() {
    this(1);
  }

  /**
   * @param amount Amount to add
   */
  public AddFunction(final int amount) {
    this.amount = amount;
  }

  /**
   * @param arg Number to add to
   * @return {@code arg} + {@code amount}
   */
  public Integer apply(final Integer arg) {
    return arg + amount;
  }
}
